package com.bradz.mytv;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Gallery;
import android.widget.TextView;

public class activityTutorial extends Activity{
	/*private int[] tutorialIds = {
			R.drawable.tutorial1,
            R.drawable.tutorial1,
            R.drawable.tutorial2,
            R.drawable.tutorial3,
            R.drawable.tutorial4,
            R.drawable.tutorial5,
            R.drawable.tutorial6,
            R.drawable.tutorial7,
            R.drawable.tutorial8,
            R.drawable.tutorial9
    };*/
	private String[] tutorialStrings = {
			"Welcome to myTV. The personal television network application. Press the \"Back\" at any time to quit to the " +
			"main menu. Swipe right to continue.",
            "You will be unable to start myTV when the application is first run. " +
            "You must first click on the \"Manage Channels\" button.",
            "Click on \"Add Channel\" to add a channel to your network.",
            "Name your new channel, then click \"Next\"",
            "You will be redirected to the folder navigator. Select the shows you want to add to your " +
            "new channel",
            "Click \"Submit\" when you have finished selecting the shows to add to your channel.",
            "You should see your new channel in the list of the Manage Channels window. Repeat the previous " +
            "steps as many times as you like to put more channels on the network.",
            "Clicking on your channel should show the list of shows associated with the channel.",
            "Clicking on the \"X\" button next to the channel will allow you to delete the channel.",
            "Navigate back to the main menu and click on \"Start myTV\" to start the program! Press the \"Back\" button " +
            "to quit to the main menu."
    };
	private TextView tutorial_text;
	@Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tutorial);
       
        tutorial_text = (TextView) findViewById(R.id.tutorial_text);
        //tutorial_text
		Gallery gallery = (Gallery) findViewById(R.id.tutorial_gallery);
        gallery.setSpacing(1);
        //gallery.setAdapter(new classTutorialImageAdapter(this,tutorialIds));

         // clicklistener for Gallery
        gallery.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View v, int position,long id) {
				// TODO Auto-generated method stub
				tutorial_text.setText(tutorialStrings[position]);
			}
        });
    }
	@Override
	public void onBackPressed() {
		Intent myIntent = new Intent(getBaseContext(), activityMain.class);
		startActivity(myIntent);
		finish();
	}
}
